package com.yili.oa.dao;

import com.yili.oa.models.FtTradeType;
import com.yili.oa.models.FtTradeTypeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface FtTradeTypeMapper {
    @SelectProvider(type=FtTradeTypeSqlProvider.class, method="countByExample")
    long countByExample(FtTradeTypeExample example);

    @DeleteProvider(type=FtTradeTypeSqlProvider.class, method="deleteByExample")
    int deleteByExample(FtTradeTypeExample example);

    @Delete({
        "delete from ft_trade_type",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into ft_trade_type (id, trade_type)",
        "values (#{id,jdbcType=INTEGER}, #{tradeType,jdbcType=VARCHAR})"
    })
    int insert(FtTradeType record);

    @InsertProvider(type=FtTradeTypeSqlProvider.class, method="insertSelective")
    int insertSelective(FtTradeType record);

    @SelectProvider(type=FtTradeTypeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.VARCHAR)
    })
    List<FtTradeType> selectByExample(FtTradeTypeExample example);

    @Select({
        "select",
        "id, trade_type",
        "from ft_trade_type",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.VARCHAR)
    })
    FtTradeType selectByPrimaryKey(Integer id);

    @UpdateProvider(type=FtTradeTypeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") FtTradeType record, @Param("example") FtTradeTypeExample example);

    @UpdateProvider(type=FtTradeTypeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") FtTradeType record, @Param("example") FtTradeTypeExample example);

    @UpdateProvider(type=FtTradeTypeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(FtTradeType record);

    @Update({
        "update ft_trade_type",
        "set trade_type = #{tradeType,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(FtTradeType record);
}